Socket
Socket
Sign inDemoInstall

void-elements

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

void-elements

Array of "void elements" defined by the HTML specification.


Version published
Weekly downloads
7.3M
decreased by-0.66%
Maintainers
2
Weekly downloads
 
Created

What is void-elements?

The void-elements npm package provides a list of HTML void elements. Void elements are HTML elements that do not have closing tags, such as <img>, <br>, and <input>. This package is useful for developers who need to handle or validate HTML content programmatically.

What are void-elements's main functionalities?

List of Void Elements

This feature provides a list of all HTML void elements. The code sample demonstrates how to import the package and log the list of void elements to the console.

const voidElements = require('void-elements');
console.log(voidElements);

Check if an Element is Void

This feature allows you to check if a given HTML tag is a void element. The code sample shows how to create a function that checks if a tag name is in the list of void elements and demonstrates its usage with 'img' and 'div' tags.

const voidElements = require('void-elements');
const isVoidElement = (tagName) => voidElements.includes(tagName);
console.log(isVoidElement('img')); // true
console.log(isVoidElement('div')); // false

Other packages similar to void-elements

Keywords

FAQs

Package last updated on 31 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc